package com.study.design.state;

import lombok.ToString;
import lombok.extern.slf4j.Slf4j;


/**
 * @version V1.0
 * @title: Work
 * @description: ${DESCRIPTION}
 * @author: wanghuilong
 * @date: 2019-06-26 11:33
 * @copyright: http://fingo.com.my/
 */
@Slf4j
public class Work {
    private State current;
    private double hour;
    private boolean finish = false;

    public Work() {
        log.info("addLogStart Work InputParam: ");
        this.current = new ForenoonState();
    }

    public void setCurrent(State current) {
        log.info("addLogStart setCurrent InputParam: current : {} ", current);
        this.current = current;
    }

    public double getHour() {
        log.info("addLogStart getHour InputParam: ");

        return hour;
    }

    public void setHour(double hour) {
        log.info("addLogStart setHour InputParam: hour : {} ", hour);
        this.hour = hour;
    }

    public boolean getTaskFinished() {
        log.info("addLogStart getTaskFinished InputParam: ");

        return finish;
    }

    public void setTaskFinished(boolean finish) {
        log.info("addLogStart setTaskFinished InputParam: finish : {} ", finish);
        this.finish = finish;
    }

    public void WriteProgram() {
        log.info("addLogStart WriteProgram InputParam: ");
        current.WriteProgram(this);
    }
}
